<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">城市:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-city_id" data-rule="required" data-source="general/lihua_city/index" data-order-by="weigh desc" class="form-control selectpage" name="row[city_id]" type="text" value="{$row.city_id|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-pic" class="control-label col-xs-12 col-sm-2">{:__('Pic')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-pic" data-rule="required" class="form-control" size="50" name="row[pic]" type="text" readonly value="{$row.pic|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span>
                        <button 
                            type="button" id="plupload-pic" 
                            class="btn btn-danger plupload" data-input-id="c-pic" 
                            data-mimetype="image/gif,image/jpeg,image/png,image/jpg" 
                            data-url="xajax/uppic/group/original" 
                            data-maxsize="10M" 
                            data-multiple="false" 
                            data-preview-id="p-pic" 
                            >
                            <i class="fa fa-upload"></i> 上传</button>
                    </span>
                </div>
                <span class="msg-box n-right" for="c-pic"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-pic"></ul>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Starttime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-starttime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[starttime]" type="text" value="{:$row.starttime?datetime($row.starttime):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Endtime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-endtime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[endtime]" type="text" value="{:$row.endtime?datetime($row.endtime):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">类型:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                <label for="row[type]-1"><input id="row[type]-1" name="row[type]" type="radio" value="1" {in name="row.type" value="1"}checked {/in} /> 登录领红包 </label>
                <label for="row[type]-2"><input id="row[type]-2" name="row[type]" type="radio" value="2" {in name="row.type" value="2"}checked {/in} /> 文章营销活动 </label>
            </div>
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">是否每天可领:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                <label for="row[everyday]-0">
                    <input id="row[everyday]-0" name="row[everyday]" type="radio" value="0" {in name="row.everyday" value="0"}checked {/in} /> 否 </label>
                <label for="row[everyday]-1">
                    <input id="row[everyday]-1" name="row[everyday]" type="radio" value="1" {in name="row.everyday" value="1"}checked {/in} /> 是 </label>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Active_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input 
                id="c-active_id" 
                data-source="Lihua_bonus_act/sel" 
                class="form-control selectpage" 
                data-field="name" 
                name="row[active_id]" 
                type="text" 
                value="{$row.active_id|htmlentities}" 
                >
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">选择宣传文案:</label>
        <div class="col-xs-12 col-sm-8">
            <input 
                id="c-article_id" 
                data-source="lihua_articles/sel" 
                class="form-control selectpage" 
                data-field="name" 
                name="row[article_id]" 
                type="text" 
                value="{$row.article_id|htmlentities}" 
                >
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
